package com.woniu108.order.controller;


import com.woniu108.carService.commos.model.Result;
import com.woniu108.order.mapper.OrderServiceInfoMapper;
import com.woniu108.order.model.dto.OrderServiceInfoDto;
import com.woniu108.order.model.model.OrderService;
import com.woniu108.order.model.model.OrderServiceInfo;
import com.woniu108.order.service.OrderServiceInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 订单服务详情表 前端控制器
 * </p>
 *
 * @author yanxi
 * @since 2024-05-23
 */
@RestController
@RequestMapping("/orderServiceInfo")
@Api(tags = "服务订单清单详情服务")
public class OrderServiceInfoController {
    @Resource
    private OrderServiceInfoService orderServiceInfoService;

    /**
     * 根据订单编号查询订单清单
     * @param orderServiceNum 订单服务编号
     * @return List<OrderServiceInfoDto> 服务清单
     */
    @ApiOperation("根据订单编号查询订单清单")
    @GetMapping("/queryOrderServiceInfoByOrderServiceNum/{orderServiceNum}.c")
    public Result<List<OrderServiceInfoDto>> queryOrderServiceInfoByOrderServiceNum(@ApiParam("服务订单编号")@PathVariable("orderServiceNum")String orderServiceNum){
        List<OrderServiceInfoDto> orderServiceInfoDtos=orderServiceInfoService.selectOrderServiceInfoByOrderServiceNum(orderServiceNum);
        return Result.newListInstance(OrderServiceInfoDto.class).setMsg("查询订单清单成功").setData(orderServiceInfoDtos);
    }
}

